<template>
  <div class="item" @click="onClick">
    <div class="item__content">
      <h2 class="item__title">{{ item.title }}</h2>
      <p class="item__text">{{ item.content }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: "Item",
  methods: {
    onClick() {
      console.log("Clicked!");
      this.$router.push({ name: "detail" });
    },
  },
  data: function () {
    return {};
  },
  props: ["item"],
};
</script>

<style scoped>
.item {
  padding: 10px;
  border-radius: 5px;
  background-color: #fff;
  box-shadow: 0 0 5px #ccc;
  text-align: left;
  display: flex;
  justify-content: space-between;
}
.item-image {
  width: 100%;
  height: 50px;
  text-align: center;
}
img {
  width: 20px;
  height: 20px;
}
</style>
